import React, { Component } from 'react';
import { NavBar } from 'antd-mobile';
// import TabBar from '../components/TabBar';
// import { bindActionCreators } from 'redux';
// import { redirect } from '../redux/actions/global';
// import { connect } from 'react-redux';
// import fetch from 'isomorphic-fetch';

class Demo1 extends Component {
  state = {
    data: [{
      article_num: "579306",
      class_id: "6",
      custom:1,
      img_url: "/app/upload/user/1501126220_9175_thumb.png",
      name: "博闻博论",
      visit_num: "1523"
    }]
  }
  componentDidMount(){
    // fetch('http://teacher.edu.cn/jiaoyu/item/index')
    // .then(res => res.json())
    // .then(data => {
    //   this.setState({
    //     data: data.data
    //   })
    // });
  }
  render() {
    // const { redirect } = this.props;
    // console.log('props', this.props);
    return (
      <div className="page">
        <NavBar>Demo1111</NavBar>
        <div>111</div>
        <div>111</div>
        <div>111</div>
        <div>111</div>
        <div>111</div>
        <div>111</div>
        <div>111</div>
        <div>111</div>
        <div>111</div>
      </div>
    );
  }
}

// <div className="page">
//   <NavBar>Demo1</NavBar>
//   <TabBar />
//   <div className="content demo1">
//     <div>{this.state.data.map((data, index) => {
//       return <div key={index}>{data.name}</div>
//     })}</div>
//     <div onClick={redirect.bind(this, '/demo5', 'left')}>列表</div>
//     <div onClick={redirect.bind(this, '/demo6/name', 'left')}>传参数</div>
//   </div>
// </div>


// const mapStateToProps = (state) => {
//   return {
//   }
// }
// // redux 绑定dispath
// const mapDispatchToProps = (dispatch) => {
//   return {
//     redirect: bindActionCreators(redirect, dispatch)
//   }
// }
//
// Demo1 = connect(mapStateToProps, mapDispatchToProps)(Demo1)
export default Demo1;
